#pragma once

#include <msxml2.h>
#include "exception.h"

class XmlElement
{
private:
	IXMLDOMElement *pElement;

public:
	XmlElement(IXMLDOMElement *pElement,bool stealRef);
	XmlElement(const XmlElement &src);
	~XmlElement();

	XmlElement AddNewElement(const std::string &name);

	void AddNewAttribute(const std::string &name,const std::string &value);
};

class XmlDocument
{
private:
	IXMLDOMDocument *pDoc;

public:
	XmlDocument();
	XmlDocument(const XmlDocument &src);
	~XmlDocument();

	void Write(const std::string &fileName) const;

	XmlElement CreateRootElement(const std::string &name);
};